import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

export default new Vuex.Store({
  state: {
    count: 200,
    num: 400,
  },
  mutations: {
    /* mutations的方法会接受state作为第一个参数 */
    increase(state) {
      state.count++;
    },
    increaseN(state, payload) {
      state.count += payload.n;
    },
  },
  actions: {},
  getters: {},
});
